/**
 * 自定义组件
 * create by xai on 29/06/2018 9:08 AM
 */

import React from 'react'

export default class CustomAtomic extends React.Component {
  focus (e) {
    console.log(e.target)
  }
  onMouseOver () {
    this.props.editor.setEditorProp('readOnly', true)
  }
  onMouseLeave () {
    this.props.editor.setEditorProp('readOnly', false)

  }
  render () {
    console.log(this.props)
    return (
      <div className="braft-custom-atomic"
           onMouseOver={this.onMouseOver.bind(this)}
           onMouseLeave={this.onMouseLeave.bind(this)}>
        hello world 11111
        <input type="text" ref={e => this.input = e} onClick={this.focus.bind(this)} />
      </div>
    )
  }
}
